﻿Imports PTIC_GestionBDD
Imports Actuariat
Imports PTIC_Util
Imports System.Data

Public Class baseMoteur
    Inherits Traitement

#Region "Variables globales"
    Protected _resultats As Object
    Protected _recalcul As typeRecalcul
#End Region

#Region "Création d'une instance"
    Public Sub New(ByVal nom As String, _
               ByVal coll_Param As ParametresList, _
               ByVal universBDD As UniversOMANE)
        MyBase.New(nom, universBDD)
        _resultats = New Object()
        Recalcul = typeRecalcul.Automatique
    End Sub
#End Region

#Region "Propriétés"
    Public Property Recalcul() As typeRecalcul
        Get
            Return _recalcul
        End Get
        Set(ByVal value As typeRecalcul)
            _recalcul = value
        End Set
    End Property
    Public Overridable Property Resultats() As Object
        Get
            Return _resultats
        End Get
        Set(ByVal value As Object)
            _resultats = value
        End Set
    End Property
#End Region

#Region "Héritage traitement"
    Public Overrides Function execute_BDD() As String
        Return Nothing
    End Function
    Public Overrides Function execute_DataTable(ByVal stockageBDDlocale As Boolean) As System.Data.DataTable
        Return Nothing
    End Function
    Public Overrides Function execute_DataTableToDgv(ByVal stockageBDDlocale As Boolean, ByVal dgv As System.Windows.Forms.DataGridView) As System.Data.DataTable
        Return Nothing
    End Function
#End Region

End Class


Public Class Moteur_Echeancier
    Inherits baseMoteur

#Region "Variables de classe"
#Region "Paramètres"
    Protected _longueurProj As Integer
    Protected _ageInit As Double
    Protected _capIni As Double
    Protected _txNomPer As Double
    Protected _nbInitialAssures As Double
    Protected _txRembAnti As Double
    Protected _txEntreeINCINV As Double
    Protected _txTaxeDC As Double
    Protected _txFG As Double
    Protected _txTech As Double
    Protected _tarifINCINV As Double
    Protected _tarifDC As Double
    Protected _ageFinINCINV As Double
    Protected _ageFinDC As Double
    Protected _txComPartenaire As Double
    Protected _abtMNO As Double
    Protected _abtPerteRevenus As Double
    Protected _majSinDC As Double
    Protected _majSinINCINV As Double

    Protected _tableMort As tableMortalite
    Protected _tableMaintienINCINV As tableMaintienINCAPINVAL
    Protected _controleurSelectionMedicale As controleurSelectionMedicale

    Protected _vision As Actuariat.typeVision
    Protected _terme As Actuariat.typeTerme
#End Region
#End Region
#Region "Création d'une instance"
    Public Sub New(ByVal nom As String, _
                   ByVal coll_Param As ParametresList, _
                   ByVal universBDD As UniversOMANE)
        MyBase.New(nom, coll_Param, universBDD)
        _resultats = New resultatsEcheancier
        defaut()
    End Sub
    Public Sub defaut()
        _longueurProj = 120
        _ageInit = 40
        _capIni = 10000
        _txNomPer = mensualise_tx(0.0434, typeMensualisation.tauxProportionel)
        _nbInitialAssures = 1000
        _txRembAnti = mensualise_tx(0.05, typeMensualisation.tauxProportionel)
        _txEntreeINCINV = 0.005
        _txTaxeDC = 0.09
        _txFG = 0.075
        _txTech = mensualise_tx(0.02, typeMensualisation.tauxEquivalent)
        _tarifINCINV = mensualise_tx(0.00149, typeMensualisation.tauxProportionel)
        _tarifDC = mensualise_tx(0.003, typeMensualisation.tauxProportionel)
        _ageFinINCINV = 65
        _ageFinDC = 75
        _txComPartenaire = 0.385
        _abtMNO = 0.2
        _abtPerteRevenus = 0.3
        _majSinDC = 0.12
        _majSinINCINV = 0.045
        Dim parametreSelectionMedicale As parametreSelectionMedicale = New parametreSelectionMedicale(nomSel_medic, "Sélection médicale", New Boolean() {True, True})
        _controleurSelectionMedicale = New controleurSelectionMedicale(parametreSelectionMedicale)
        Dim valeurUniqueSelMedic As Double() = New Double() {0}
        _controleurSelectionMedicale.setValeurUnique(valeurUniqueSelMedic)
        _vision = typeVision.DEBPER
        _terme = typeTerme.TERME
    End Sub
#End Region
#Region "Propriétés"
    Public Overloads Function getResultats() As resultatsEcheancier
        Return _resultats
    End Function
#End Region
#Region "Calcul du scénario central"
    Public Sub calculScenarioCentral()

        getResultats.Clear()
        calculScenCentProjMensuelle()
        calculScenCentProjAnnuelle()
        notifieChangement(Me, notification.moteur2aEteRecalcule)

    End Sub
    Private Sub calculScenCentProjMensuelle()

        Dim echeanceMensuelle As Double = -Pmt(_txNomPer, _longueurProj, _capIni, 0, 0)
        getResultats.EcheanceMensuelle = echeanceMensuelle

        'Création d'une dataTable à utiliser pour l'affichage du modèle 2
        Dim resProjections As New DataTable()
        resProjections.Columns.Add("NumMois", GetType(Integer))
        resProjections.Columns.Add("NumAnnee", GetType(Integer))
        resProjections.Columns.Add("IndAnneePleine", GetType(Integer))
        resProjections.Columns.Add("EchDeb", GetType(Double))
        resProjections.Columns.Add("EchFin", GetType(Double))
        resProjections.Columns.Add("AgeActuMilPer", GetType(Double))
        resProjections.Columns.Add("TxMortMilPer", GetType(Double))
        resProjections.Columns.Add("NbCotisantsDebPer", GetType(Double))
        resProjections.Columns.Add("nbCotisants", GetType(Double))
        resProjections.Columns.Add("nbSinDC", GetType(Double))
        resProjections.Columns.Add("NbSinistresINCAPINVALFinPer", GetType(Double))
        resProjections.Columns.Add("CotisCommINCINV", GetType(Double))
        resProjections.Columns.Add("CotisCommDC", GetType(Double))
        resProjections.Columns.Add("CotisTechINCINV", GetType(Double))
        resProjections.Columns.Add("CotisTechDC", GetType(Double))
        resProjections.Columns.Add("SinRegDC", GetType(Double))
        resProjections.Columns.Add("SinRegINCINV", GetType(Double))
        resProjections.Columns.Add("projPMRente", GetType(Double))
        resProjections.Columns.Add("ProjPPRC", GetType(Double))
        resProjections.Columns.Add("ProjPMDC", GetType(Double))
        resProjections.Columns.Add("projPMINCINV", GetType(Double))
        resProjections.Columns.Add("ProjCSRDC", GetType(Double))
        resProjections.Columns.Add("MSR_Vie", GetType(Double))

        Dim selMedic As Double() = _controleurSelectionMedicale.getValeurUnique
        Dim isSelMedic As Boolean = Not (selMedic Is Nothing)

        Dim num_periodes As Integer() = Actuariat.proj_num_periodes(_longueurProj)
        Dim num_annee As Integer() = Actuariat.proj_num_annee(_longueurProj)
        Dim ind_anneesPleines As Integer() = Actuariat.proj_ind_anneesPleines(_longueurProj)

        Dim proj_echeancier_deb As Double() = Actuariat.proj_echeancier(_longueurProj, _capIni, _txNomPer, typeVision.DEBPER, _terme)
        Dim proj_echeancier_fin As Double() = Actuariat.proj_echeancier(_longueurProj, _capIni, _txNomPer, typeVision.FINPER, _terme)
        Dim proj_ages As Double() = Actuariat.proj_ages(_ageInit, _longueurProj)
        Dim proj_txMort As Double() = Actuariat.proj_mortalites(proj_ages, _tableMort.values, selMedic, _longueurProj, isSelMedic)
        Dim proj_nbCotisants As Double(,) = Actuariat.proj_cotisants(_longueurProj, _nbInitialAssures, _txRembAnti, proj_txMort)
        Dim result As Object
        result = Actuariat.proj_nb_INCINV( _
            _longueurProj, _
            _nbInitialAssures, _
            _txEntreeINCINV, _
            proj_ages, _
            proj_nbCotisants, _
            _tableMaintienINCINV)
        Dim proj_nbINCAPINVAL As Double(,) = result(0)
        Dim proj_evolINCAPINVAL As Double(,) = result(1)

        Dim proj_cotis_ComDC As Double() = Actuariat.proj_Cotis_comDC( _
            _longueurProj, _
            _capIni, _
            proj_ages, _
            proj_echeancier_deb, _
            proj_echeancier_fin, _
            _tarifDC, _
            typeTarif.CapitalInitial, _
            typeTerme.TERME, _
            proj_nbCotisants, _
            _ageFinDC)
        Dim proj_cotis_techDC As Double() = Actuariat.proj_Cotis_techDC( _
            _longueurProj, _
            proj_cotis_ComDC, _
            _txFG, _
            _txComPartenaire)
        Dim proj_cotis_comINCINV As Double() = Actuariat.proj_Cotis_comINCINV( _
            _longueurProj, _
            _capIni, _
            proj_ages, _
            proj_echeancier_deb, _
            proj_echeancier_fin, _
            _tarifINCINV, _
            typeTarif.CapitalInitial, _
            typeTerme.TERME, _
            proj_nbCotisants, _
            _ageFinINCINV)
        Dim proj_cotis_techINCINV As Double() = Actuariat.proj_Cotis_techINCINV( _
            _longueurProj, _
            proj_cotis_comINCINV, _
            _txFG, _
            _txComPartenaire, _
            _txTaxeDC)

        Dim projNbSinDC As Double() = Actuariat.proj_nbSinDC( _
            _longueurProj, _
            proj_ages, _
            _ageFinDC, _
            proj_nbCotisants, _
            proj_txMort)

        Dim proj_sin_DC As Double() = Actuariat.proj_sin_regDC( _
            _longueurProj, _
            proj_ages, _
            _ageFinDC, _
            proj_nbCotisants, _
            proj_txMort, _
            proj_echeancier_deb, _
            _majSinDC)
        Dim proj_sin_INCINV As Double() = Actuariat.proj_sin_regINCINV( _
            _longueurProj, _
            proj_ages, _
            _ageFinINCINV, _
            proj_nbINCAPINVAL, _
            echeanceMensuelle, _
            _abtMNO, _
            _abtPerteRevenus, _
            _majSinINCINV)

        Dim proj_PM_Rente As Double() = Actuariat.proj_prov_rente( _
            _longueurProj, _
            proj_evolINCAPINVAL, _
            proj_nbINCAPINVAL, _
            proj_txMort, _
            _txRembAnti, _
            echeanceMensuelle, _
            _txTech, _
            _capIni, _
            _tarifINCINV, _
            _txFG, _
            _txComPartenaire, _
            _txTaxeDC, _
            _abtMNO, _
            _abtPerteRevenus, _
            _majSinINCINV)
        Dim proj_PPRC As Double() = Actuariat.proj_prov_PPRC( _
            _longueurProj, _
            proj_evolINCAPINVAL, _
            proj_nbINCAPINVAL, _
            proj_txMort, _
            _txRembAnti, _
            echeanceMensuelle, _
            _txTech, _
            _capIni, _
            _tarifINCINV, _
            _txFG, _
            _txComPartenaire, _
            _txTaxeDC, _
            _abtMNO, _
            _abtPerteRevenus, _
            _majSinINCINV)
        Dim proj_PM_DC As Double() = Actuariat.proj_PM_DC( _
            _longueurProj, _
            proj_cotis_techDC, _
            proj_sin_DC, _
            _txTech)
        Dim proj_PM_INCINV As Double() = Actuariat.proj_PM_INCINV( _
            _longueurProj, _
            proj_cotis_techINCINV, _
            proj_sin_INCINV, _
            _txTech)

        Dim projCSR As Double() = Actuariat.proj_CSR_DC( _
            _longueurProj, _
            proj_echeancier_fin, _
            proj_nbCotisants)

        Dim proj_MSR_Vie As Double() = Actuariat.proj_MSR_vie(_longueurProj, projCSR)

        For i As Integer = 0 To _longueurProj - 1
            Dim newRow As DataRow = resProjections.NewRow
            newRow("NumMois") = num_periodes(i)
            newRow("NumAnnee") = num_annee(i)
            newRow("IndAnneePleine") = ind_anneesPleines(i)
            newRow("EchDeb") = proj_echeancier_deb(i)
            newRow("EchFin") = proj_echeancier_fin(i)
            newRow("AgeActuMilPer") = proj_ages(i)
            newRow("TxMortMilPer") = proj_txMort(i)
            newRow("NbCotisantsDebPer") = proj_nbCotisants(i, 0)
            newRow("nbCotisants") = proj_nbCotisants(i, 1)
            newRow("NbSinistresINCAPINVALFinPer") = proj_nbINCAPINVAL(i, 3)
            newRow("nbSinDC") = projNbSinDC(i)
            newRow("CotisCommINCINV") = proj_cotis_comINCINV(i)
            newRow("CotisCommDC") = proj_cotis_ComDC(i)
            newRow("CotisTechINCINV") = proj_cotis_techINCINV(i)
            newRow("CotisTechDC") = proj_cotis_techDC(i)
            newRow("SinRegDC") = proj_sin_DC(i)
            newRow("SinRegINCINV") = proj_sin_INCINV(i)
            newRow("projPMRente") = proj_PM_Rente(i)
            newRow("ProjPPRC") = proj_PPRC(i)
            newRow("ProjPMDC") = proj_PM_DC(i)
            newRow("projPMINCINV") = proj_PM_INCINV(i)
            newRow("ProjCSRDC") = projCSR(i)
            newRow("MSR_Vie") = proj_MSR_Vie(i)


            resProjections.Rows.Add(newRow)
        Next

        getResultats.ProjectionMensuelle = resProjections
        getResultats.EcheanceMensuelle = echeanceMensuelle
    End Sub
    Private Sub calculScenCentProjAnnuelle()

        Dim resProjectionAnn As New DataTable
        resProjectionAnn.Columns.Add("numAnnee", GetType(Integer))
        resProjectionAnn.Columns.Add("CSRDCfin", GetType(Double))
        resProjectionAnn.Columns.Add("cotisDC", GetType(Double))
        resProjectionAnn.Columns.Add("sinDC", GetType(Double))
        resProjectionAnn.Columns.Add("PM_DCtheo", GetType(Double))
        resProjectionAnn.Columns.Add("cotisIT", GetType(Double))
        resProjectionAnn.Columns.Add("sinIT", GetType(Double))
        resProjectionAnn.Columns.Add("PM_Rente", GetType(Double))
        resProjectionAnn.Columns.Add("PPRC", GetType(Double))
        resProjectionAnn.Columns.Add("PM_ITtheo", GetType(Double))
        resProjectionAnn.Columns.Add("MSR_Vie", GetType(Double))

        resProjectionAnn.Columns.Add("nbCotisants", GetType(Double))
        resProjectionAnn.Columns.Add("NbSinistresINCAPINVALFinPer", GetType(Double))
        resProjectionAnn.Columns.Add("nbSinDC", GetType(Double))


        'Récupération de la projection mensuelle
        Dim resProjectionMensuelle As DataTable = getResultats.ProjectionMensuelle

        Dim numAnnee As Integer = 0
        Dim rowEnCours As DataRow = Nothing
        For numMois As Integer = 1 To resProjectionMensuelle.Rows.Count
            If Math.Ceiling(numMois / 12) <> numAnnee Then
                If Not rowEnCours Is Nothing Then
                    resProjectionAnn.Rows.Add(rowEnCours)
                End If
                rowEnCours = resProjectionAnn.NewRow()
                rowEnCours("cotisDC") = 0
                rowEnCours("sinDC") = 0
                rowEnCours("nbSinDC") = 0
                rowEnCours("cotisIT") = 0
                rowEnCours("sinIT") = 0
                numAnnee = Math.Ceiling(numMois / 12)
            End If
            If numMois / 12 = numAnnee Then
                rowEnCours("NumAnnee") = numAnnee
                rowEnCours("CSRDCfin") = resProjectionMensuelle.Rows(numMois - 1)("ProjCSRDC")
                rowEnCours("PM_DCtheo") = resProjectionMensuelle.Rows(numMois - 1)("ProjPMDC")
                rowEnCours("PM_Rente") = resProjectionMensuelle.Rows(numMois - 1)("projPMRente")
                rowEnCours("PPRC") = resProjectionMensuelle.Rows(numMois - 1)("ProjPPRC")
                rowEnCours("PM_ITtheo") = resProjectionMensuelle.Rows(numMois - 1)("projPMINCINV")
                rowEnCours("MSR_Vie") = resProjectionMensuelle.Rows(numMois - 1)("MSR_Vie")
                rowEnCours("nbCotisants") = resProjectionMensuelle.Rows(numMois - 1)("nbCotisants")
                rowEnCours("NbSinistresINCAPINVALFinPer") = resProjectionMensuelle.Rows(numMois - 1)("NbSinistresINCAPINVALFinPer")
            End If
            rowEnCours("cotisDC") = rowEnCours("cotisDC") + resProjectionMensuelle.Rows(numMois - 1)("CotisCommDC")
            rowEnCours("sinDC") = rowEnCours("sinDC") + resProjectionMensuelle.Rows(numMois - 1)("SinRegDC")
            rowEnCours("nbSinDC") = rowEnCours("nbSinDC") + resProjectionMensuelle.Rows(numMois - 1)("nbSinDC")
            rowEnCours("cotisIT") = rowEnCours("cotisIT") + resProjectionMensuelle.Rows(numMois - 1)("CotisCommINCINV")
            rowEnCours("sinIT") = rowEnCours("sinIT") + resProjectionMensuelle.Rows(numMois - 1)("SinRegINCINV")
        Next
        If Not rowEnCours Is Nothing Then
            rowEnCours("NumAnnee") = numAnnee
            rowEnCours("CSRDCfin") = 0
            rowEnCours("PM_DCtheo") = 0
            rowEnCours("PM_Rente") = 0
            rowEnCours("PPRC") = 0
            rowEnCours("PM_ITtheo") = 0
            rowEnCours("MSR_Vie") = 0
            rowEnCours("nbCotisants") = 0
            rowEnCours("NbSinistresINCAPINVALFinPer") = 0

            resProjectionAnn.Rows.Add(rowEnCours)
        End If

        getResultats.ProjectionAnnuelle = resProjectionAnn

    End Sub
#End Region
#Region "Paramètres"
#Region "Taux nominal mensuel du prêt"
    Public Function getTxNomPer() As Double
        Return _txNomPer
    End Function
    Public Sub setTxNomPer(ByVal txNomPer As Double)
        _txNomPer = txNomPer
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
#End Region
#Region "Capital initial"
    Public Function getcapIni() As Double
        Return _capIni
    End Function
    Public Sub setcapIni(ByVal capIni As Double)
        _capIni = capIni
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
#End Region
#Region "Durée actuarielle du prêt en mois"
    Public Function getLongueurProj() As Integer
        Return _longueurProj
    End Function
    Public Sub setLongueurProj(ByVal longueur As Integer)
        _longueurProj = longueur
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
#End Region
#Region "Age initial à la souscription"
    Public Function getAgeInit() As Double
        Return _ageInit
    End Function
    Public Sub setAgeInit(ByVal ageInit As Double)
        _ageInit = ageInit
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
#End Region
#Region "Table de mortalité"
    Public Function getTableMort() As tableMortalite
        Return _tableMort
    End Function
    Public Sub setTableMort(ByVal tableMortalite As tableMortalite)
        _tableMort = tableMortalite
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
#End Region
#Region "Table de maintien en INCAP/INVAL"
    Public Sub setTableMaintienINCAPINVAL(ByVal tableMaintienINCINV As tableMaintienINCAPINVAL)
        _tableMaintienINCINV = tableMaintienINCINV
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTableMaintienINCAPINVAL() As tableMaintienINCAPINVAL
        Return _tableMaintienINCINV
    End Function
#End Region
#Region "Taux de remboursements anticipés"
    Public Function getTxRembAnti() As Double
        Return _txRembAnti
    End Function
    Public Sub setTxRembAnti(ByVal rembAnti As Double)
        _txRembAnti = rembAnti
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
#End Region
#Region "Nombre initial d'assurés"
    Public Function getNbInitAssures() As Double
        Return _nbInitialAssures
    End Function
    Public Sub setNbInitAssures(ByVal NbInitAssures As Double)
        _nbInitialAssures = NbInitAssures
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
#End Region
#Region "Taux d'entrée en INCAP/INVAL"
    Public Sub setTxEntreeINCINV(ByVal txEntree As Double)
        _txEntreeINCINV = txEntree
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTxEntreeINCINV() As Double
        Return _txEntreeINCINV
    End Function
#End Region
#Region "Taux de taxe DC"
    Public Sub setTxTaxeDC(ByVal txTaxeDC As Double)
        _txTaxeDC = txTaxeDC
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTxTaxeDC() As Double
        Return _txTaxeDC
    End Function
#End Region
#Region "Taux de frais de gestion"
    Public Sub setTxFG(ByVal txFG As Double)
        _txFG = txFG
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTxFG() As Double
        Return _txFG
    End Function
#End Region
#Region "Taux technique"
    Public Sub setTxTech(ByVal txTech As Double)
        _txTech = txTech
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTxTech() As Double
        Return _txTech
    End Function
#End Region
#Region "Tarif An INCAP/INVAL"
    Public Sub setTarifINCINV(ByVal tarifINCINV As Double)
        _tarifINCINV = tarifINCINV
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTarifINCINV() As Double
        Return _tarifINCINV
    End Function
#End Region
#Region "Tarif An DC"
    Public Sub setTarifDC(ByVal tarifDC As Double)
        _tarifDC = tarifDC
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTarifDC() As Double
        Return _tarifDC
    End Function
#End Region
#Region "Age fin INC/INV"
    Public Sub setAgeFinINCINV(ByVal ageFinINCINV As Double)
        _ageFinINCINV = ageFinINCINV
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getAgeFinINCINV() As Double
        Return _ageFinINCINV
    End Function
#End Region
#Region "Age fin DC"
    Public Sub setAgeFinDC(ByVal ageFinDC As Double)
        _ageFinDC = ageFinDC
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getAgeFinDC() As Double
        Return _ageFinDC
    End Function
#End Region
#Region "Tx Com Partenaire"
    Public Sub setTxComPartenaire(ByVal txComPartenaire As Double)
        _txComPartenaire = txComPartenaire
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getTxComPartenaire() As Double
        Return _txComPartenaire
    End Function
#End Region
#Region "Abattement MNO"
    Public Sub setAbtMNO(ByVal abtMNO As Double)
        _abtMNO = abtMNO
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getAbtMNO() As Double
        Return _abtMNO
    End Function
#End Region
#Region "Abattement perte de revenus"
    Public Sub setAbtPerteRev(ByVal abtPerteRev As Double)
        _abtPerteRevenus = abtPerteRev
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getAbtPerteRev() As Double
        Return _abtPerteRevenus
    End Function
#End Region
#Region "Majoration sinistres DC"
    Public Sub setMAJsinDC(ByVal majSinDC As Double)
        _majSinDC = majSinDC
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getMajSinDC() As Double
        Return _majSinDC
    End Function
#End Region
#Region "Majoration sinistres INC/INV"
    Public Sub setMajSinINCINV(ByVal majSinINCINV As Double)
        _majSinINCINV = majSinINCINV
        If Recalcul = typeRecalcul.Automatique Then calculScenarioCentral()
    End Sub
    Public Function getMajSinINCINV() As Double
        Return _majSinINCINV
    End Function
#End Region
#Region "Sélection médicale"
    Public Function getControleurSelectionMedicale() As controleurSelectionMedicale
        Return _controleurSelectionMedicale
    End Function
#End Region
#End Region

#Region "Méthodes d'exécution - héritées de la classe traitement"
    Public Overrides Function execute_BDD() As String
        'Enregistre la table des calculs détaillés résultant du modèle 2 dans la base de données
        Return Nothing
    End Function
    Public Overrides Function execute_DataTable(ByVal stockageBDDlocale As Boolean) As System.Data.DataTable
        'Exécute le calcul du scénario central et renvoie les calculs détaillés sous forme de dataTable
        Return Nothing
    End Function
    Public Overrides Function execute_DataTableToDgv(ByVal stockageBDDlocale As Boolean, ByVal dgv As System.Windows.Forms.DataGridView) As System.Data.DataTable
        'Exécute le calcul du scénario central et intégre la table détaillée des résultats dans un dataGGridView
        Return Nothing
    End Function
#End Region

    Public Enum notification
        moteur2aEteRecalcule
    End Enum

    Public Class resultatsEcheancier
        Protected _echeanceMensuelle As Double
        Protected _ProjectionMensuelle As DataTable
        Protected _ProjectionAnnuelle As DataTable
        Public Property ProjectionMensuelle() As DataTable
            Get
                Return _ProjectionMensuelle
            End Get
            Set(ByVal value As DataTable)
                _ProjectionMensuelle = value
            End Set
        End Property
        Public Property ProjectionAnnuelle() As DataTable
            Get
                Return _ProjectionAnnuelle
            End Get
            Set(ByVal value As DataTable)
                _ProjectionAnnuelle = value
            End Set
        End Property
        Public Property EcheanceMensuelle() As Double
            Get
                Return _echeanceMensuelle
            End Get
            Set(ByVal value As Double)
                _echeanceMensuelle = value
            End Set
        End Property
        Public Sub clear()
            _echeanceMensuelle = 0
            _ProjectionMensuelle = Nothing
            _ProjectionAnnuelle = Nothing
        End Sub
    End Class

End Class